package com.ming.day250804;

public class e_while {
    public static void main(String[] args) {
        //int i = 1;
        //do{
        //    System.out.println("hello world");
        //    i++;
        //}while(i <= 5);

        for (int i = 0; i < 3; i++) {
            System.out.println("for:我爱钱");
        }
        //System.out.println(i);

        int j = 0;
        while (j < 3) {
            System.out.println("while:我爱钱");
            j++;
            int x = 10;
        }
        //System.out.println(j);

        int h = 0;
        do {
            System.out.println("do while:我爱钱");
            h++;
        } while (h < 3);


        ////1.定义一个变量sum,用于接收两个数的和
        //int sum = 0;
        ////2.利用for循环将1-3表示出来,循环相加
        //for (int i = 1;i<=3;i++){
        //    //3.两两相加,将结果赋值给sum
        //    sum+=i;//sum = sum+i;
        //}
        ////4.输出sum
        //System.out.println("sum = " + sum);

        ////1.定义三个变量分别表示山峰高度,纸的厚度,和折叠次数
        //int mountain = 8844430;
        //double paper = 0.1;
        //int count = 0;
        ////2.循环判断,如果纸的厚度小于山峰高度,就对折,次数+1
        //while (paper<mountain){
        //    paper*=2;
        //    count++;
        //}
        ////3.输出折叠次数
        //System.out.println("折叠次数 = " + count);

        //int count = 0;
        //int i = 1;
        //while (i <= 100) {
        //    if (i % 2 == 1) {
        //        count++;
        //    }
        //    i++;
        //}
        //System.out.println("count = " + count);

        //int sum = 0;
        //int i = 1;
        //while(i <= 100){
        //    sum+=i;
        //    i++;
        //}
        //System.out.println("sum = " + sum);
    }
}
